////////////////////////////////////////////////////////////////////////
//
// write.html
//
////////////////////////////////////////////////////////////////////////
var msgSendURL = "http://minsus.com/app/secret-box/msg_send.php";

$('#write').live('pageinit',function(event)
{
	document.getElementById("receiver").innerHTML = receiver + "   ( "+addHyphen(receiverNum)+" )";
});
function sendMail()
{
	sendingMail = document.getElementById("sendingMail").value;
	
//	alert (receiver + " \n" + sendingMail);
//    var msg = "";
//    var sender = "";
//    var receiver = "";
    var sendMsg = msgSendURL + "?msg=" + encodeURIComponent(sendingMail) + "&sender=" + myPhoneNum + "&receiver=" + receiverNum;
//    alert(sendMsg);
    $.ajax({
        url: sendMsg,
        type: "GET",
        success: function(jsonData){
            var obj = JSON.parse(jsonData);
           if (unescape(obj.result) == 'success') {
           $.mobile.changePage('mylist.html');
           }
//            alert(unescape(obj.result));
        }
    });
}